using System;
using System.Reactive.Concurrency;

namespace Bull.Core
{
    internal sealed class SchedulerImpl : IScheduler
    {
        private readonly IScheduler _scheduler = DispatcherScheduler.Current;
        public IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)
        {
            return _scheduler.Schedule(state, action);
        }

        public IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
        {
            return _scheduler.Schedule(state, dueTime, action);
        }

        public IDisposable Schedule<TState>(TState state, DateTimeOffset dueTime, Func<IScheduler, TState, IDisposable> action)
        {
            return _scheduler.Schedule(state, dueTime, action);
        }

        public DateTimeOffset Now { get; private set; }
    }
}